package com.bdqn.demo03;

import com.bdqn.demo02.Buyer;
import com.bdqn.demo02.RealBuyer;
import com.bdqn.demo02.logger.ATM;
import com.bdqn.demo02.logger.Account;
import com.bdqn.demo02.logger.MemberATM;

/**
 * TestJDKProxy
 *
 * @author LILIBO
 * @since 2022-09-27
 */
public class TestJDKProxy {

    public static void main(String[] args) {
        Buyer buyer = JDKProxyFactory.create(new RealBuyer());
        String result = buyer.havealook();
        System.out.println("执行结果：" + result);

        ATM atm = JDKProxyFactory.create(new MemberATM());
        boolean flag = atm.transfer(new Account(1, "王健伟", 100000), new Account(2, "田文鑫", 100), 3000);
        System.out.println("执行结果：" + flag);
    }
}
